import axios from './index'
import { transformFormData } from '@/libs/util'

/**
* @description 登录
* @param {String} userName 用户名/手机号
* @param {String} password 密码
*/
export const login = ({ userName, password }) => axios.request({
    url: 'api/public/login',
    data: transformFormData({
        phone: userName,
        password
    }),
    method: 'post'
})

/**
* @description 获取用户信息
* @param {String} token token密钥
*/
export const getUserInfo = token => axios.request({
    url: 'api/app/getCurrentMember',
    params: {
        token
    },
    method: 'get'
})